package com.kgis.fm.model.system;

import java.io.Serializable;
import java.util.Date;

/**
 http://spring.group.iteye.com/group/blog/815998

 @Transient和transient关键字在hibernate中和memcache中应用

 将字段标识为transient可以使得POJO的这个字段不被映射到数据库中的字段,但是如果要将这个POJO存入memcache就会无法存储(如果这个POJO是实现的Serializable,而不是Externalizable接口自己写的序列化方面实现)。
 只有将字段用注解@Transient的方式标志,就能实现不映射到数据库,同时又能序列化到memcache中。
 如下代码：
 Java代码
 private transient ProjectInfoState projectInfoState;


 @Transient
 private ProjectInfoState projectInfoState;
 */
public class UserContext implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 9176941891434972231L;

	/**
	 * check with userContext from rmi parameters
	 */
	private String guid;

	/** */
	private String hostName;

	/** */
	private String hostAddress;

	/** */
	private String operator;

	/** */
	private long userId;


	private transient Date operateDate;

	public Date getOperateDate() {
		if (null == operateDate) {
			operateDate = new Date();
		}
		return operateDate;
	}

	/**
	 * @return the guid
	 */
	public String getGuid() {
		return guid;
	}

	/**
	 * @param guid
	 *            the guid to set
	 */
	public void setGuid(String guid) {
		this.guid = guid;
	}

	/**
	 * @return the hostName
	 */
	public String getHostName() {
		return hostName;
	}

	/**
	 * @param hostName
	 *            the hostName to set
	 */
	public void setHostName(String hostName) {
		this.hostName = hostName;
	}

	/**
	 * @return the hostAddress
	 */
	public String getHostAddress() {
		return hostAddress;
	}

	/**
	 * @param hostAddress
	 *            the hostAddress to set
	 */
	public void setHostAddress(String hostAddress) {
		this.hostAddress = hostAddress;
	}

	/**
	 * @return the operator
	 */
	public String getOperator() {
		return operator;
	}

	/**
	 * @param operator
	 *            the operator to set
	 */
	public void setOperator(String operator) {
		this.operator = operator;
	}

	/**
	 * @return the userId
	 */
	public long getUserId() {
		return userId;
	}

	/**
	 * @param userId
	 *            the userId to set
	 */
	public void setUserId(long userId) {
		this.userId = userId;
	}

	/**
	 * @param operateDate
	 *            the operateDate to set
	 */
	public void setOperateDate(Date operateDate) {
		this.operateDate = operateDate;
	}

}
